package edu.uj.petri.view;

import edu.uj.petri.model.Place;
import edu.uj.util.Observed;
import edu.uj.util.Observer;
import java.awt.geom.Point2D;
import java.io.Serializable;

/**
 * view of Petri net as a diagram. As Observed, notifies of every change in it.
 */
public interface View extends Serializable, Observed, Observer {
    
    /** event code for Observed */
    public static final int CHANGED=6522;
    
    /**
     * returns clicked element or null when nothing is on this point
     * @param point point with coordinates in Units from Canvas
     */
    public DiagramElement getClickedElement(Point2D point, boolean nodeonly);
    
    public void clickSelectableElement(DiagramElement elm);

    /**
     * clears selection of diagram elements
     */
    public void selectNone();
    
    public void addElement(DiagramElement elm);

    public void draw();

    public void removeElement(DiagramElement elm);
    
    public void setCanvas(Canvas canvas);
    
    public Canvas getCanvas();
    
}
